package com.xjy.rpc.proxy.cglib;

import com.xjy.rpc.proxy.IProxy;
import net.sf.cglib.proxy.Enhancer;

public class CglibProxyFactory implements IProxy {
    @Override
    public <T> T getProxy(Class<T> clazz) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(clazz);
        enhancer.setCallback(new CglibProxy(clazz));
        return (T) enhancer.create();
    }
}
